import { defineStore } from "pinia";

export const collapseStore = defineStore('collapse', {
    // 定义state
    state: () => {
        return {
            // 控制左侧栏收缩：false展开 true收缩
            isCollapse: false
        }
    },

    // 定义getters
    getters: {
        getCollapse: (state) => {
            return state.isCollapse;
        }
    },

    // 定义actions
    actions: {
        setCollapse() {
            this.isCollapse = !this.isCollapse;
        },
        setCollapseIsTrue() {
            this.isCollapse = false;
        }
    }
})
